package kr.saeildamil.androidstudty.ch13;

import kr.saeildamil.androidstudty.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarTest extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbartest);
		mProgBar = (ProgressBar) findViewById(R.id.ch13_progressbartest_progress);
		mProgCircle = (ProgressBar) findViewById(R.id.ch13_progressbartest_progresscircle);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.ch13_progressbartest_decfirstbtn:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_progressbartest_incfirstbtn:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progressbartest_decsecondbtn:
			mProgBar.incrementSecondaryProgressBy(-2);
			break;
		case R.id.ch13_progressbartest_incsecondbtn:
			mProgBar.incrementSecondaryProgressBy(2);
			break;
		case R.id.ch13_progressbartest_startbtn:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
		case R.id.ch13_progressbartest_stopbtn:
			mProgCircle.setVisibility(View.INVISIBLE);
		}
	}
}
